package com.ui.zhixiao.controller;


import com.ui.zhixiao.common.R;
import com.ui.zhixiao.domain.Video;
import com.ui.zhixiao.service.videoService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/video")
@Api(tags = "视频相关接口")
@Slf4j
public class videoController {
    @Autowired
    private videoService videoService;

//    @GetMapping("/list")
//    public R<List<Video>> list(@RequestBody Video video) {
//    List<Video> list=videoService.list(video);
//    return R.success(list);
//    }
@GetMapping("/list")
public List<Video> list(@RequestParam(value = "subject", required = false) String subject,
                        @RequestParam(value = "innerSubject", required = false) String innerSubject) {
    return videoService.getVideosByCategory(subject, innerSubject);
}


}
